Objective: The objective of this study is to develop a machine learning model for simulating the nitrate concentration. Simulating and predicting nitrate concentration has always been one of the most important issues in the field of water resources management. Method: In this research, after collecting the data, the nitrate concentration data are first clustered using the JNB, then, an SVR model is used for each cluster. The SFFS algorithm is used to select the input variables for the model simultaneously with the training process of this model, then, based on the results of these three models, the average value of the error indices for the training stage (RMSE = 0.2387, MAE = 0.2236, R^ 2=0.9874) and test (RMSE = 0.2474, MAE = 0.2350, R^2=0.9841) are calculated. In this case, the trial and error procedure is used for this work. In the next step, the HHO algorithm is used to determine the optimal value of the parameters of the kernel functions. In this case, the values of R2, MAE and RMSE for the training phase are 0.9961, 0.1169, and 0.1502, respectively, and their values for the test phase are 0.9845, 0.1308, and 0.9978, respectively. Results: Based on the results of this study, firstly, the use of HHO to predict nitrate concentration can significantly increase the accuracy of the SVR model, secondly, the use of different machine learning models together can play an effective role in increasing the accuracy of regression models such as SVR. The results of this study show that the use of data clustering before developing machine learning models can improve the accuracy of nitrate concentration prediction. The HHO-SVR hybrid model has performed better in different clusters with proper selection of kernel function and has provided optimal results. Also, this study emphasizes that the different statistical characteristics of each cluster have a significant effect on the performance of the models. Therefore, to more accurately predict nitrate concentration in groundwater, it is recommended to first cluster the data and then develop a specific model for each cluster. Conclusions: The results of this study show that the use of data clustering before developing machine learning models can improve the accuracy of nitrate concentration prediction. The HHO-SVR hybrid model has performed better in different clusters with proper selection of kernel function and has provided optimal results. Also, this study emphasizes that the different statistical characteristics of each cluster have a significant effect on the performance of the models. Therefore, to more accurately predict nitrate concentration in groundwater, it is recommended to first cluster the data and then develop a specific model for each cluster.